/*
 * @Description: 
 * @Author: Jimmy
 * @Date: 2023-07-26 19:12:09
 * @LastEditTime: 2023-07-26 19:38:20
 * @LastEditors:  
 */
import { DataTypes } from "sequelize";
import seq from "../db/seq";

const Depart = seq.define('depart',{
    parent_id:{
        type:DataTypes.STRING,
        allowNull:false,
        unique:false,
        comment:"部门id  不能为空"
    },
    name:{
        type:DataTypes.STRING,
        allowNull:false,
        unique:true,
        comment:'部门名称 唯一'
    },
    code:{
        type:DataTypes.STRING,
        allowNull:false,
        unique:true,
        comment:'部门编码 唯一'
    },
    status:{
        type:DataTypes.BOOLEAN,
        allowNull:false,
        defaultValue:0,
        comment:'部门状态'
    }
},{
    tableName:'depart',
    createdAt: "createTime",
    updatedAt: "updateTime"
});

// Depart.sync({force:true});
export default Depart;